package com.hczoop.utils.web;

import java.util.Random;


public final class RandomUtil {

	//public static final String STRNUMBSER="0123456789";
	
	public static String getRandomString(int len){
		StringBuilder str = new StringBuilder();
		Random r = new Random();
		for( int i = 0 ; i < len ; i ++ ) {
			str.append(r.nextInt(10));
		}
		return str.toString();
	}
	
	public static String getRandomString(String preffix,int len,String suffix){
		StringBuilder q = new StringBuilder();
		if(!StringUtil.isEmpty(preffix)){
			q.append(preffix);
		}
		q.append(getRandomString(len));
		if(!StringUtil.isEmpty(suffix)){
			q.append(suffix);
		}
		return q.toString();
	} 
	
	public static void main(String[] args) {
		System.out.println(getRandomString(6));
	}
}
